Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove gas accounting from AotContractExecutor #938

Merged
merged 7 commits into from
Nov 26, 2024
Merged

Conversation

edg-l
Copy link
Collaborator

@edg-l edg-l commented Nov 21, 2024

Removes the initial gas cost calculations and substractions, the caller will handle it.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.

@edg-l edg-l changed the title Add a initial_gas_cost parameter to AotContractExecutor and a helper constant (10k) Remove gas accounting from AotContractExecutor Nov 21, 2024
Copy link

github-actions bot commented Nov 21, 2024

✅ Code is now correctly formatted.

Copy link

github-actions bot commented Nov 21, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.190 ± 0.407 10.724 11.668 8.30 ± 0.30
cairo-native (embedded AOT) 3.501 ± 0.109 3.390 3.686 2.60 ± 0.08
cairo-native (embedded JIT using LLVM's ORC Engine) 3.252 ± 0.038 3.202 3.333 2.41 ± 0.03
cairo-native (standalone AOT with -march=native) 1.348 ± 0.004 1.346 1.358 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.930 ± 0.299 10.649 11.456 140.17 ± 3.86
cairo-native (embedded AOT) 2.969 ± 0.023 2.942 3.009 38.08 ± 0.31
cairo-native (embedded JIT using LLVM's ORC Engine) 2.770 ± 0.019 2.745 2.812 35.53 ± 0.26
cairo-native (standalone AOT with -march=native) 0.078 ± 0.000 0.078 0.078 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.211 ± 0.032 4.147 4.268 17.34 ± 0.20
cairo-native (embedded AOT) 3.075 ± 0.026 3.043 3.121 12.66 ± 0.16
cairo-native (embedded JIT using LLVM's ORC Engine) 3.029 ± 0.027 2.984 3.055 12.47 ± 0.16
cairo-native (standalone AOT with -march=native) 0.243 ± 0.002 0.242 0.250 1.00

Copy link

github-actions bot commented Nov 21, 2024

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 3.195 ± 0.036 3.156 3.272 1.00
base factorial_2M.cairo (AOT) 3.383 ± 0.036 3.345 3.440 1.06 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 3.178 ± 0.018 3.160 3.213 1.00
head factorial_2M.cairo (AOT) 3.355 ± 0.015 3.336 3.391 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 2.755 ± 0.040 2.704 2.825 1.00
base fib_2M.cairo (AOT) 2.915 ± 0.010 2.896 2.929 1.06 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 2.718 ± 0.020 2.681 2.743 1.00
head fib_2M.cairo (AOT) 2.917 ± 0.020 2.886 2.940 1.07 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.062 ± 0.040 3.015 3.136 1.00
base logistic_map.cairo (AOT) 3.104 ± 0.039 3.065 3.179 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.014 ± 0.017 2.988 3.048 1.00
head logistic_map.cairo (AOT) 3.088 ± 0.034 3.045 3.146 1.02 ± 0.01

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 70.90909% with 16 lines in your changes missing coverage. Please review.

Project coverage is 82.55%. Comparing base (2b945fc) to head (16e30e2).

Files with missing lines Patch % Lines
src/bin/scarb-native-dump.rs 0.00% 5 Missing ⚠️
src/bin/cairo-native-compile.rs 0.00% 3 Missing ⚠️
src/bin/cairo-native-run.rs 0.00% 3 Missing ⚠️
src/bin/utils/test.rs 0.00% 3 Missing ⚠️
src/bin/cairo-native-dump.rs 0.00% 1 Missing ⚠️
src/bin/cairo-native-stress/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #938      +/-   ##
==========================================
- Coverage   82.63%   82.55%   -0.08%     
==========================================
  Files         117      117              
  Lines       33505    33505              
==========================================
- Hits        27687    27661      -26     
- Misses       5818     5844      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@edg-l edg-l added the review-ready A PR that is ready for review label Nov 25, 2024
azteca1998
azteca1998 previously approved these changes Nov 25, 2024
src/executor/contract.rs Outdated Show resolved Hide resolved
gabrielbosio
gabrielbosio previously approved these changes Nov 25, 2024
@edg-l edg-l enabled auto-merge November 26, 2024 12:37
@edg-l edg-l mentioned this pull request Nov 26, 2024
@edg-l edg-l added this pull request to the merge queue Nov 26, 2024
Merged via the queue into main with commit adb25da Nov 26, 2024
32 checks passed
@edg-l edg-l deleted the contract_initial_cost branch November 26, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready A PR that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants